package requests

import (
	"github.com/goravel/framework/contracts/http"
	"github.com/goravel/framework/contracts/validation"
)

type RoleSyncRequest struct {
	RoleID           uint   `form:"role_id" json:"role_id"`
	PermissionIDs    []uint `form:"permission_ids" json:"permission_ids"`
	BtnPermissionIDs []uint `form:"btn_permission_ids" json:"btn_permission_ids"`
}

func (r *RoleSyncRequest) Authorize(ctx http.Context) error {
	return nil
}

func (r *RoleSyncRequest) Filters(ctx http.Context) map[string]string {
	return map[string]string{}
}

func (r *RoleSyncRequest) Rules(ctx http.Context) map[string]string {
	return map[string]string{
		"role_id": "required",
	}
}

func (r *RoleSyncRequest) Messages(ctx http.Context) map[string]string {
	return map[string]string{
		"role_id.required": "角色不能为空",
	}
}

func (r *RoleSyncRequest) Attributes(ctx http.Context) map[string]string {
	return map[string]string{}
}

func (r *RoleSyncRequest) PrepareForValidation(ctx http.Context, data validation.Data) error {
	return nil
}
